package com.springboot.service.recordAdmin.recordAdmin.impl;

import com.springboot.dao.AdminInfoDao;
import com.springboot.dao.RecordAdminDao;
import com.springboot.entity.AdminInfo;
import com.springboot.entity.RecordAdmin;
import com.springboot.service.admin.adminInfo.AdminLoginAuthService;
import com.springboot.service.recordAdmin.recordAdmin.RecordAdminLoginAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : sugar without coffee
 * @version 1.0.0
 */
@Service
public class RecordAdminLoginAuthServiceImpl implements RecordAdminLoginAuthService {

    @Autowired
    private RecordAdminDao recordAdminDaoImpl;

    @Override
    public boolean recordAdminLoginAuth(RecordAdmin recordAdmin) {
        try{
            if(recordAdmin.getRecordAdminPassword().equals(recordAdminDaoImpl.selectRecordAdminByRecordAdminId(recordAdmin.getRecordAdminId()).get("recordAdminPassword"))){
                return true;
            }else{
                return false;
            }
        }catch (NullPointerException ex){
            return false;
        }
    }

}
